package Wuchong;
import java.util.Scanner;
public class TestDemo {
    public static void main(String[] args){
        Master master=new Master();
        Scanner sc=new Scanner(System.in);
        System.out.println("从键盘输入num的值:");
        int num=0;
        num=sc.nextInt();
        Pet pet=null;
        if(num==0){
        //形成is-a关系
         pet =new Dog();
      master.Crue(pet);
        }else {
      //添加新的代码
      pet=new Penguin();
      master.Crue(pet);
        }
}
}
